In ajax programming, we often need to assign the page content obtained by xmlhttp to a container (such as div, span, or td) through innerHTML, but there is a problem here, that is, if the page content we will assign to innerHTML contains scripts,
1. In JavaScript, first let's see that innerHTML and innertext can be used to get the contents of a DOM element.
We can write this:
(1) When using innertext
In JS we,
The results obtained are as follows:
(2) when using innerHTML
Run this code
InnerHTML is a strange HTML attribute, not supported by W3C standards, but almost all vendors support this attribute by default. Recently, some tests have used this attribute, here are some interesting questions about innerHTML. All elements have
In ajax programming, we often need to assign the page content obtained by xmlhttp to a container (such as div, span, or td) through innerHTML, but there is a problem here, that is, if the page content we will assign to innerHTML contains scripts,
When doing Ajax programming, we often need to get XMLHTTP to the content of the page through the InnerHTML to assign to a container (such as Div, span or TD, etc.), but there is a problem, is that we will be assigned to InnerHTML page content if
The innerHTML of tbody in the IE6-IE9 cannot be assigned a value. The reproduction code is as follows:Copy codeThe Code is as follows: innerHTML of tbody in IE6-IE9 cannot copy bug aaa GET SET Two buttons: the first to get the innerHTML of
The tbody innerHTML in IE6/IE7/IE8/IE9 cannot be assigned a value and the following code is reproduced
Copy Code code as follows:
Tbody innerHTML cannot be duplicated in
aaa
getSET
Two buttons, the
The IE6-IE9 in the tbody innerHTML can not assign a value to the solution, ie6-ie9tbody
The innerHTML of tbody in the IE6-IE9 cannot be assigned a value. The reproduction code is as follows:
Js Code
innerHTML of tbody in IE6-IE9 cannot copy bugs
The tbody innerHTML in IE6-IE9 cannot be assigned a value and the following code is reproduced
Copy Code code as follows:
Tbody innerHTML cannot be duplicated in IE6-IE9 bug
aaa
getSET
A recent project has been used in a strange way, using a label to display HTML content, and then continue to use JS to copy the label's innerHTML into a textbox.However, yesterday found a problem, get the element value, sometimes normal, sometimes
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.